﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Sockets;
using System.Net;
using System.Timers;

namespace MyTestProject.NUnity.TcpClient
{
    /// <summary>
    /// 通讯接口事件代理
    /// </summary>
    public delegate void CommRxEventHandler();
    public delegate void CommIdleEventHandler();

    /// <summary>
    /// 通讯接口
    /// </summary>
    public interface ICommunication
    {
        event CommRxEventHandler CommRxEvent;       //收到数据事件
        event CommIdleEventHandler CommIdleEvent;   //通讯空闲事件

        int CommSend(byte[] buffer, int size);      //发送数据到通讯口
        int CommReceive(CommBuffer buffer);         //从通讯口接收数据
        int CommReceive(byte[] buffer, int size);   //从通讯口接收数据
    }
}
